Skip to main content

Radar

The radar allows you to detect objects in the direction of the arrow on the texture. The radars detection is based on the surface area of the object, the distance it is away from you and your scan angle. If you have a smaller scan range in general, you will be able to see further and you will be able to detect smaller bodies. A larger scan range will result in the opposite.


Structure

Target

A target is an object detected from the radar.

Fields:

  • position [ Vec3 ] The position of the target.
  • velocity [ Vec3 ] The velocity of the target.
  • mass [ number ] The mass of the object.
  • isDynamic [ boolean ] Whether the object is dynamic or not (always true for units).
  • surfaceArea [ number ] The total surface area that the radar can see.
  • type [ string ] The type of the object the radar can see (Currently 'creation' or 'unit').
  • id [ integer ] The id of the object, (dependant on type).

Functions

getTargets

Radar.getTargets()

Gets all the targets that the radar has detected.

Returns:


setVerticalScanAngle

Radar.setVerticalScanAngle( angle )

Sets the radars vertical angle from 10 to 90 degrees.

Arguments:

  • angle [ number ] The angle to set.

setHorizontalScanAngle

Radar.setHorizontalScanAngle( angle )

Sets the radars horizontal angle from 10 to 90 degrees.

Arguments:

  • angle [ number ] The angle to set.